home *** CD-ROM | disk | FTP | other *** search
- #ifndef _SERVERINFO_H_
- #define _SERVERINFO_H_
- /*
- * $RCSfile: serverinfo.h,v $
- * $Revision: 1.1.1.1 $
- * $Date: 1996/05/04 21:55:20 $
- */
- /**********************************************************************
- * EXODUS Database Toolkit Software
- * Copyright (c) 1991 Computer Sciences Department, University of
- * Wisconsin -- Madison
- * All Rights Reserved.
- *
- * Permission to use, copy, modify and distribute this software and its
- * documentation is hereby granted, provided that both the copyright
- * notice and this permission notice appear in all copies of the
- * software, derivative works or modified versions, and any portions
- * thereof, and that both notices appear in supporting documentation.
- *
- * THE COMPUTER SCIENCES DEPARTMENT OF THE UNIVERSITY OF WISCONSIN --
- * MADISON ALLOWS FREE USE OF THIS SOFTWARE IN ITS "AS IS" CONDITION.
- * THE DEPARTMENT DISCLAIMS ANY LIABILITY OF ANY KIND FOR ANY DAMAGES
- * WHATSOEVER RESULTING FROM THE USE OF THIS SOFTWARE.
- *
- * The EXODUS Project Group requests users of this software to return
- * any improvements or extensions that they make to:
- *
- * EXODUS Project Group
- * c/o David J. DeWitt and Michael J. Carey
- * Computer Sciences Department
- * University of Wisconsin -- Madison
- * Madison, WI 53706
- *
- * or exodus@cs.wisc.edu
- *
- * In addition, the EXODUS Project Group requests that users grant the
- * Computer Sciences Department rights to redistribute these changes.
- **********************************************************************/
-
- /*
- * This file contains structures used to maintain information
- * about servers that the client is connected to, or can connect to.
- */
- #include "forward.h"
- #include "bf.h"
- #include "sysdefs.h"
- #include "loginfo.h"
- #include "trans.h"
-
- /* BEGIN visible to user */
- #define MAX_HOSTNAME 100
- #define MAX_SERVERNAME 100
- /* END visible to user */
-
-
- class SERVERINFO {
- public:
- FLAGS flags; /* SERV_xxx below */
- int socket;
- char hostName[MAX_HOSTNAME];
- HOSTENT *hostEnt;
- SOCKADDR connectAddr;
- char name[MAX_SERVERNAME];
- LOGINFO logInfo;
- LIST transList; /* transactions using this server */
- LISTELEMENT list; /* for use by pool & hash table */
-
- /* These are really just for bookkeeping & sanity checking */
- short int nMounted; /* # volumes we have mounted on this server */
-
- void Init();
- void ReInit();
- BOOL Dump(FILE *f);
- SOCKADDRCLASS *keylocation(int unique, SOCKADDRCLASS **unused);
- LISTELEMENT *listlocation(int unique);
- };
-
- #define SERV_NOTCONNECTED 0x0
- #define SERV_CONNECTED 0x1 /* has a tcp connx */
- #define SERV_ESTAB 0x2 /* INIT_CLIENT done */
- #define SERV_LOGGING_INITD 0x4 /* a clog_serverInit was done
- (not done for administrative clients) */
- #define SERV_IN_TX 0x8 /* has a transaction active */
- #define SERV_MOUNTED_VOL 0x10 /* mounted the given volume
- (for use with a VOLREC *) */
- #define SERV_CONTACTED_IN_PAST 0x80 /* not in use */
-
- #define NOSOCKET -1
-
- extern int ServerInfoPoolSize;
- extern int ServerInfoTableSize;
-
- /* stuff for distributed transactions: */
- /*************************************************************************
- * NB: must #define away the SERVERINFO * for users.
- *************************************************************************/
- #ifndef __USER__
- #define void SERVERINFO
- #endif
- /* BEGIN visible to user */
- /*
- * define the coordinator handle
- */
- typedef struct {
- TID coordTid;
- char hostName[MAX_HOSTNAME]; /* a.b.c.d of the server's host
- from inet_ntoa(host's inaddr) */
- char serverName[MAX_SERVERNAME];
- /* string representation of port # */
-
- } COORD_HANDLE;
- /* END visible to user */
- #ifndef __USER__
- #undef void
- #endif
-
-
- #endif _SERVERINFO_H_
-